﻿<%@ Page Title="" Language="C#" MasterPageFile="~/CVSA.Master" AutoEventWireup="true"
    CodeBehind="ListaChamadosRemedy.aspx.cs" Inherits="CVSA.Suporte.Sinacor.BMFBovespa.ConsultaRemedy.ListaChamadosRemedy" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <style type="text/css">
        body
        {
            font-family: Calibri;
            font-size: 11pt;
            border: solid 1px;
            margin: 0px;
        }
        .style1
        {
            vertical-align: top;
            width: 150px;
        }
        .tb
        {
            margin-left: 50px;
        }
    </style>

    <script type="text/javascript" language="javascript">
        function showDetail(control) {
            if (control.style.display == 'none') {
                control.style.display = 'block';
            }
            else {
                control.style.display = 'none';
            }

        }
    </script>

</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <p align="center" style="font-size: 15pt">
        <u>Pesquisa de Chamados</u>
    </p>
    <p align="right">
        Última atualização em :
        <asp:Literal runat="server" ID="ltUltimaAtualizacao" />
    </p>
    <table class="tb">
        <tr>
            <td>
                <table border="1">
                    <tr>
                        <td class="style1">
                            Nome da corretora:
                        </td>
                        <td>
                            <asp:TextBox runat="server" ID="txtNomeCorretora" onkeyup="javascript:setTimeout('__doPostBack(\'ctl00$ContentPlaceHolder1$btnPesquisar\',\'\')', 500)"
                                Width="590px" />
                        </td>
                        <td>
                            N° Chamado:
                        </td>
                        <td>
                            <asp:TextBox runat="server" ID="txtIdIncidente" onkeyup="javascript:setTimeout('__doPostBack(\'ctl00$ContentPlaceHolder1$btnPesquisar\',\'\')', 500)"
                                Width="150px" />
                        </td>
                    </tr>
                    <tr>
                        <td>
                            Pesquisar Chamados:
                        </td>
                        <td>
                            <asp:RadioButtonList runat="server" ID="rdTpPesquisaChamados" RepeatDirection="Vertical">
                                <asp:ListItem Text="<b>Pesquisar chamados abertos.</b>" Selected="True" Value="0"
                                    onclick="javascript:setTimeout('__doPostBack(\'ctl00$ContentPlaceHolder1$btnPesquisar\',\'\')', 500)" />
                                <asp:ListItem Text="Pesquisar chamados abertos e fechados." Selected="False" Value="1"
                                    onclick="javascript:setTimeout('__doPostBack(\'ctl00$ContentPlaceHolder1$btnPesquisar\',\'\')', 500)" />
                            </asp:RadioButtonList>
                        </td>
                        <td>
                            Analista:
                        </td>
                        <td>
                            <asp:TextBox runat="server" ID="txtPessoa" onkeyup="javascript:setTimeout('__doPostBack(\'ctl00$ContentPlaceHolder1$btnPesquisar\',\'\')', 500)"
                                Width="150px" />
                        </td>
                    </tr>
                    <tr>
                        <td valign="top">
                            Área Designada:
                        </td>
                        <td valign="top">
                            <asp:CheckBoxList runat="server" ID="chkAreasChamado" RepeatColumns="2" RepeatDirection="Vertical"
                                onclick="javascript:setTimeout('__doPostBack(\'ctl00$ContentPlaceHolder1$btnPesquisar\',\'\')', 500)" />
                        </td>
                        <td class="style1" valign="top">
                            Prioridade:
                        </td>
                        <td valign="top">
                            <asp:CheckBoxList runat="server" ID="chkLstPrioridade" RepeatColumns="2" RepeatDirection="Vertical"
                                onclick="javascript:setTimeout('__doPostBack(\'ctl00$ContentPlaceHolder1$btnPesquisar\',\'\')', 500)">
                                <asp:ListItem Selected="True" Text="Critical" Value="Critical" />
                                <asp:ListItem Selected="True" Text="Medium" Value="Medium" />
                                <asp:ListItem Selected="True" Text="High" Value="High" />
                                <asp:ListItem Selected="True" Text="Low" Value="Low" />
                            </asp:CheckBoxList>
                        </td>
                    </tr>
                </table>
            </td>
        </tr>
        <tr>
            <td>
                <table>
                    <tr>
                        <td>
                            Legendas:
                        </td>
                        <td>
                            <span style="background-color: #FFFFFF; border: solid 1px black">&nbsp;&nbsp;Suporte
                                Nível 1&nbsp;&nbsp;</span>
                        </td>
                        <td>
                            <span style="background-color: #990000; color: #FFFFFF; border: solid 1px black">&nbsp;&nbsp;Suporte
                                Nível 2 (Negócio) &nbsp;&nbsp;</span>
                        </td>
                        <td>
                            <span style="background-color: #004080; color: #FFFFFF; border: solid 1px black">&nbsp;&nbsp;Em
                                andamento&nbsp;&nbsp;</span>
                        </td>
                        <td>
                            <span style="background-color: #FFFFFF; color: #990000; border: solid 1px black;
                                font-weight: bold">&nbsp;&nbsp;Chamados Críticos&nbsp;&nbsp;</span>
                        </td>
                        <td>
                            <span style="background-color: Teal; color: #FFFFFF; border: solid 1px black; font-weight: bold">
                                &nbsp;&nbsp;Chamados Fechados&nbsp;&nbsp;</span>
                        </td>
                    
                        <td>
                            Exportar para Excel:
                        </td>
                        <td>
                            <asp:ImageButton runat="server" ID="ExcelExport" ImageUrl="~/images/icxls.gif" OnClick="ExcelExport_Click"
                                AlternateText="Exportar para Excel" />
                        </td>
            </tr> </table> </td>
        </tr>
    </table>
    <asp:UpdateProgress ID="updProgress" runat="server" AssociatedUpdatePanelID="UpdatePanel1">
        <ProgressTemplate>
            <span style="color: red">Carregando...</span>
        </ProgressTemplate>
    </asp:UpdateProgress>
    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
        <ContentTemplate>
            <p align="center" style="font-size: 15pt">
                <u>Chamados Abertos :
                    <asp:Literal runat="server" ID="ltlQtdChamados" /></u></p>
            <div style="display: none">
                <asp:Button runat="server" ID="btnPesquisar" OnClick="btnPesquisar_Click" />
            </div>
            <asp:GridView runat="server" ID="gvChamadosRemedy" AutoGenerateColumns="False" OnRowDataBound="formatRow">
                <Columns>
                    <asp:BoundField HeaderText="Id Incidente" DataField="IdIncidente" HeaderStyle-Width="120"
                        ItemStyle-VerticalAlign="Top">
                        <HeaderStyle Width="120px" />
                        <ItemStyle VerticalAlign="Top" />
                    </asp:BoundField>
                    <asp:TemplateField ItemStyle-Width="20" ItemStyle-HorizontalAlign="Center">
                        <ItemTemplate>
                            <a href='detalheChamados.aspx?idincidente=<%# Eval ("IdIncidente").ToString() %>'>
                                <img src="images/help.gif" alt="Clique para abrir os detalhes do Incidente." border="0" runat="server" id="imgDetalheIncidente" /></a>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:BoundField HeaderText="Corretora" DataField="Empresa" HeaderStyle-Width="320"
                        ItemStyle-VerticalAlign="Top">
                        <HeaderStyle Width="320px" />
                        <ItemStyle VerticalAlign="Top" />
                    </asp:BoundField>
                    <asp:TemplateField HeaderText="Criticidade" ItemStyle-VerticalAlign="Top">
                        <ItemTemplate>
                            <%# Eval ("Prioridade").ToString() %>
                        </ItemTemplate>
                        <ItemStyle VerticalAlign="Top" />
                    </asp:TemplateField>
                    <asp:BoundField HeaderText="Data de Abertura" DataField="Data_Abertura" HeaderStyle-Width="120"
                        ItemStyle-VerticalAlign="Top">
                        <HeaderStyle Width="120px" />
                        <ItemStyle VerticalAlign="Top" />
                    </asp:BoundField>
                    <asp:BoundField HeaderText="Status" DataField="Status" HeaderStyle-Width="50" ItemStyle-VerticalAlign="Top">
                        <HeaderStyle Width="50px" />
                        <ItemStyle VerticalAlign="Top" />
                    </asp:BoundField>
                    <asp:BoundField HeaderText="Área Designada" DataField="Area_Designada" HeaderStyle-Width="270"
                        ItemStyle-VerticalAlign="Top">
                        <HeaderStyle Width="270px" />
                        <ItemStyle VerticalAlign="Top" />
                    </asp:BoundField>
                    <asp:BoundField HeaderText="Pessoa Designada" DataField="Pessoa_Designada" ItemStyle-VerticalAlign="Top">
                        <ItemStyle VerticalAlign="Top" />
                    </asp:BoundField>
                    <asp:TemplateField HeaderText="Detalhe" ItemStyle-VerticalAlign="Top" HeaderStyle-Width="300">
                        <ItemTemplate>
                            <div style="text-align: center">
                                <a runat="server" id="showDetail" href="#">
                                    <img src="img/onenote.gif" border="0" alt="Clique aqui para visualizar a descrição do chamado." runat="server" id = "imgDetalhe"/></a></div>
                            <div runat="server" id="div_txt" style="display: none">
                                <%# FormatarTexto(Eval ("Detalhe").ToString()) %>
                            </div>
                        </ItemTemplate>
                        <HeaderStyle Width="300px" />
                        <ItemStyle VerticalAlign="Top" />
                    </asp:TemplateField>
                </Columns>
                <HeaderStyle BackColor="Black" Font-Bold="True" ForeColor="White" />
                <RowStyle BorderColor="Black" />
            </asp:GridView>
        </ContentTemplate>
    </asp:UpdatePanel>
</asp:Content>
